$().ready(function(){
    var nav = getSearch('nav');
    var item = getSearch('item');
    let navList;
    for(let i in mainList){
        if (nav == mainList[i].id){
            navList = mainList[i];
        }
    }
    let navItem;
    for(let j in navList.list){
        if(item == navList.list[j].id){
            navItem = navList.list[j]
        }
    }
    var breadcream = '<a href="index.html">首页</a>';
    breadcream += '<a href="'+navList.link+'?nav='+navList.id+'">'+navList.name+'</a>';
    breadcream += '<a href="">'+navItem.name+'</a>';
    $('#breadcream').html(breadcream);
    var data;
    if(item == 8){
        data = 1;
    }else if(item == 9){
        data = 2;
    }else if(item == 10){
        data = 3;
    }
    getAjax('/Api/New/get_ptzj',res=>{
        console.log(res);
        var html = '';
        for(var i in res){
            html += '<div class="list-item">';
            html += '<div class="item-img">';
            html += '<img src="'+res[i].img+'" alt="'+res[i].title+'"> </div>';
            html += '<div class="item-content-box"><div class="item-content-title">'+res[i].title+'</div>'
            html += '<div class="item-content-text">'+res[i].content+'</div></div></div> '
        }
        $('#main-box').html(html);
    },{
        type:data
    })
})
